<?php

switch ($page) {
	
	case 'dashboard':
		$domAddCode = '
		cream_nested_accordion.init();
		// cream_calendar.init();
		cream_flist.init();
		cream_gallery.init();
		// cream_charts.charts_resize();
		// cream_charts.ds_plot1();
		// cream_charts.ds_plot2();
		cream_h_scrollable.init();';
	break;

	case 'categories':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.categories();
			cream_datatable.dt_actions_categories();
			cream_datatable.dt_actions_products();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'editcategory':
		$domAddCode = '
		cream_textarea_auto.init();
		if(!is_touch_device){
			cream_fileUpload.init();
		}
		cream_chosen_select.init();
		cream_dp_tp.init();
		cream_datatable.dt_gal();
		cream_datatable.dt_actions();
		cream_datatable.dt_actions_categories_assets();';
	break;

	case 'editproduct':
		$domAddCode = '
		cream_textarea_auto.init();
		cream_limiter.init();
		if(!is_touch_device){
			cream_fileUpload.init();
			cream_editor.html();
		}
		cream_chosen_select.init();
		cream_dp_tp.init();
		cream_datatable.dt3();
		cream_datatable.dt_gal();
		cream_datatable.dt_actions();
		cream_datatable.dt_actions_products_assets();
		cream_inplace.optionsValues();
		cream_inplace.optionsPrices();
		cream_inplace.optionsStocks();
		cream_inplace.optionsStatus();';
	break;

	case 'editoption':
		$domAddCode = 'cream_chosen_select.init();';
	break;

	case 'clients':
		$domAddCode = '
		cream_chosen_select.init();
		if(!jQuery.browser.mobile) {
			cream_datatable.clients();
			cream_datatable.dt_actions_clients();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'editclient':
		$domAddCode = '
		cream_chosen_select.init();
		cream_inplace.ordersStatus();
		if(!jQuery.browser.mobile) {
			cream_datatable.orders();
			cream_datatable.dt_actions_orders();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'orders':
		$domAddCode = '
		cream_inplace.ordersStatus();
		cream_inplace.ordersShipping();
		if(!jQuery.browser.mobile) {
			cream_datatable.orders();
			cream_datatable.dt_actions_orders();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'reductions':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.coupons();
			cream_datatable.dt_actions();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'settings':
		$domAddCode = '
		cream_textarea_auto.init();
		cream_limiter.init();
		if(!is_touch_device){
			cream_fileUpload.init();
			cream_editor.html();
		}
		cream_chosen_select.init();';
	break;

	case 'newsletters':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.newsletters();
			cream_datatable.dt_actions_newsletters();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'editnewsletter':
		$domAddCode = '
		cream_textarea_auto.init();
		cream_limiter.init();
		if(!is_touch_device){
			cream_editor.html();
		};';
	break;

	case 'mailinglist':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.mailinglist();
			cream_datatable.dt_actions_mainlinglist();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'spreadtheworld':
		$domAddCode = '
		cream_chosen_select.init();
		cream_progressbar.init();';
	break;

	case 'articles':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.articles();
			cream_datatable.dt_actions_articles();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'editarticles':
		$domAddCode = '
		cream_textarea_auto.init();
		cream_limiter.init();
		if(!is_touch_device){
			cream_editor.html();
		};
		cream_dp_tp.init();';
	break;

	case 'pages':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.pages();
			cream_datatable.dt_actions_pages();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'editpages':
		$domAddCode = '
		cream_textarea_auto.init();
		cream_limiter.init();
		if(!is_touch_device){
			cream_editor.html();
		};
		cream_dp_tp.init();';
	break;

	case 'logs':
		$domAddCode = '
		if(!jQuery.browser.mobile) {
			cream_datatable.ulogs();
			cream_datatable.alogs();
		}else{
			cream_datatable.mobile_dt();
		};';
	break;

	case 'explorer':
		$domAddCode = 'cream_fileManager.init();';
	break;
}